package com.huarui.area.service;

import java.util.List;
import java.util.Map;

import org.ewaf.framework.service.BaseService;

import com.huarui.area.dao.IAreaDao;
import com.huarui.area.model.Area;

public class AreaService extends BaseService{
	private IAreaDao getDao() {
		return (IAreaDao) dao;
	}
	
	
	public List<Area> getDistsByCityId(Integer id) {
		return this.getDao().getDistsByCityId(id);
	}
	
	public List<Area> getCitesByProvId(Integer id) {
		return this.getDao().getCitesByProvId(id);
	}
	
	public List<Area> getProvs() {
		return this.getDao().getProvs();
	}
	
	/**
	 * 后台查询
	 * @param paramsMap
	 * @return
	 */
	public Map<String, Object> getAreaListByComplex(Map<String, Object> paramsMap) {
		Integer totalProperty = getDao().getAreaListCountByComplex(paramsMap);
		List<Map<String, Object>> list = getDao().getAreaListByComplex(paramsMap);
		paramsMap.clear();
		paramsMap.put("totalProperty", totalProperty);
		paramsMap.put("root", list);
		return paramsMap;
	}
}
